cmake_minimum_required(VERSION 3.10)

find_package(Boost REQUIRED COMPONENTS date_time)

include_directories($Boost_INCLUDE_DIRS)

aux_source_directory(src SRC)

add_library(dmos SHARED ${SRC})

target_link_libraries(dmos misc) 

set_target_properties(dmos PROPERTIES WIN32_MANIFEST "NO")

install(TARGETS dmos LIBRARY)

find_package(CxxTest)
if(CXXTEST_FOUND)
    include_directories(${CXXTEST_INCLUDE_DIR})
    enable_testing()
    CXXTEST_ADD_TEST(test_oscommon test_oscommon.cpp 
    	${CMAKE_CURRENT_SOURCE_DIR}/test/shared_memory.hxx
    	${CMAKE_CURRENT_SOURCE_DIR}/test/signal_handler.hxx
    	)
	target_link_libraries(test_oscommon dmos ${Boost_LIBRARIES})
	set_target_properties(test_oscommon PROPERTIES WIN32_MANIFEST "NO")
endif()